package com.zhima.feignclient;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("oj-checkcode-service")
@RequestMapping("/oj-check-code/feign")
public interface CheckCodeFeignClient {
    /**
     * 验证向toEmail发送的验证码是否和submitCheckCode一致
     *
     * @param toEmail
     * @param submitCheckCode
     * @return
     */
    @GetMapping("/email/verify/{submitCheckCode}/{toEmail}")
    String verifyEmailCheckCode(@PathVariable("toEmail") String toEmail, @PathVariable("submitCheckCode") String submitCheckCode);

    /**
     * 验证向用户绑定邮箱发送的验证码是否和submitCheckCode一致
     *
     * @param submitCheckCode
     * @return
     */
    @GetMapping("/email/verify/{submitCheckCode}")
    String verifyEmailCheckCode(@PathVariable("submitCheckCode") String submitCheckCode);

    /**
     * 验证手机验证码是否正确
     *
     * @param toPhone
     * @param submitCheckCode
     * @return
     */
    @GetMapping("/phone/verify/{submitCheckCode}/{toPhone}")
    String verifyPhoneCheckCode(@PathVariable("toPhone") String toPhone, @PathVariable("submitCheckCode") String submitCheckCode);

    /**
     * 验证手机验证码是否正确
     *
     * @param submitCheckCode
     * @return
     */
    @GetMapping("/phone/verify/{submitCheckCode}")
    String verifyPhoneCheckCode(@PathVariable("submitCheckCode") String submitCheckCode);
}
